{extend name="public/base" /} {block name="style"}
<link href="__LIB__/fileinput/css/fileinput.min.css" rel="stylesheet" /> {/block} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>
			<a href="{:url('index')}">用户列表</a>
		</li>
		<li><strong>编辑用户</strong></li>
	</ol>
</div>
<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('update')}">
					<input type="hidden" name="id" value="{$model.id}" />
					<div class="form-group">
						<label class="col-sm-3 control-label">用户姓名：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="nick_name" name="nick_name" value="{$model.nick_name}" placeholder="" class="form-control" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">手机号码：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="mobile" name="mobile" value="{$model.mobile}" placeholder="" class="form-control" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">头像：</label>
						<div class="input-group col-sm-4">
							<input type="hidden" id="thumb" name="thumb" value="{$model.thumb}" />
							<input id="upload" name="upload" type="file" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">登录密码：</label>
						<div class="input-group col-sm-4">
							<input type="password" id="password" name="password" value="{$model.password}" class="form-control" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">确认登录密码：</label>
						<div class="input-group col-sm-4">
							<input type="password" id="password1" name="password1" value="{$model.password}" class="form-control" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>

					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">是否激活：</label>
						<div class="input-group col-sm-4">
							<label class="checkbox-inline h5">
                                <input type="radio" name="status" value="1" {if $model.status=='1'}checked{/if}> 是
							</label>
							<label class="checkbox-inline h5">
                                <input type="radio" name="status" value="0"{if $model.status=='0'}checked{/if}> 否
							</label>
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<div class="col-sm-4 col-sm-offset-3">
							<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>&nbsp;&nbsp;
							<a href="{:url('index')}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> 返回 </a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script>
	//图片上传
	upload_one('{$model.thumb}');
	$(function() {
		// 表单验证
		$("#myForm").validate({
			rules: {
				mobile: "required",
				password: "required",
				password1: {
					equalTo: "#password"
				}
			},
			messages: {
				mobile: ICON.error + "请输入手机号码",
				password: ICON.error + "请输入登录密码",
				password1: ICON.error + "2次登录密码不一致"
			},
			submitHandler: function(form) {
				ajaxForm();
			}
		});
	});
</script>
{/block}